How Traffic Lights Work And How They Influence Traffic Safety?

Essay

Traffic Lights, also known as traffic semaphore, traffic signals, traffic lamps, signal lights, stop lights, or robots (in South Africa) are controlling devices used to control traffic flow. They are often positioned at traffic intersections and on pedestrian crossings. However, they are used at road construction sites to control traffic.

First traffic lights appeared on public streets in London, United Kingdom of Great Britain and Ireland (today United Kingdom of Great Britain and Northern Ireland). They were gas-lit and required a policeman-operator to control them. However, the lights were short-lived, as they exploded less than a month after the installment, killing the operator. Despite this, the need for traffic lights arose during 1890s and Earnest Sirrine from Chicago patented the first automated traffic control system in 1910. The new lights didn't need gasoline and it used words "STOP" and "PROCEED".

During the second half of 20th century, traffic lights dropped text and ceased to be manually operated. Automatic machines that need programming have been on the rise. Also, the lights spread throughout the world and its first usage outside Europe and America was installation of traffic lights in South Indian city of Chennai in 1953. The development of traffic lights was far from over, as in 1990 timers have been added for pedestrian to time their street crossings.

Traffic lights are high-voltage electric machines. They need programming, however, as they machines are not A.Is. Moreover, traffic lights in Ontario are yellow boxes with red, yellow and green lights. The lights are placed across the intersection for each direction. Some countries place then in front of the intersection (European countries, for example).

As we see, the sequence of traffic lights here is: Red, Green, Yellow, and Red. This process is repeated again and again.

Although they serve the same purpose of controlling the traffic, differences still exist. In some jurisdictions, such as Québec, New Brunswick, and Prince Edward Island, traffic lights are positioned horizontally rather than vertically in Ontario. Also, their traffic lights have 2 red lights instead of one.
Moreover, traffic lights shapes are different.

Traffic Lights in NS American TL

The sequence and positioning are also different:

In Ontario In Europe
Ontario has both blinking red and yellow lights Only yellow and green lights can blink
Traffic lights are positioned across the intersection They are position before the intersection with some
traffic signs mounted on

My code and animation for the traffic lights assignment

				/* Traffic Light Simulator
				Made by Dragi Plakalovic
				Date: 5/2/2017 */


				// Set of variable that hold pin numbers for TL 1. (TL = Traffic Lights No. 1)
				int red = 12;
				int yellow = 10;
				int green = 8;

				// Set of variable that hold pin numbers for TL 2 (TL 2 = Traffic Lights No. 2)
				int red2 = 6;
				int yellow2 = 4;
				int green2 = 2;

				void setup() {
					// Set following pins as output pins for TL 1
					pinMode(red, OUTPUT); // Red for TL 1
					pinMode(yellow, OUTPUT); // Yellow for TL 1
					pinMode(green, OUTPUT); // Green for TL 1

					// Set following pins as output pins for TL 2
					pinMode(red2, OUTPUT); // Red for TL 2
					pinMode(yellow2, OUTPUT); // Yellow for TL 2
					pinMode(green2, OUTPUT); // Green for TL 2
				}

				void loop() {
					/* Code for running lights on TL 1 */

					// Red light 2
					digitalWrite(red2, HIGH);
					digitalWrite(yellow2, LOW);
					digitalWrite(green2, LOW);
					delay(1000);   

					// Green light 1
					digitalWrite(green, HIGH);
					digitalWrite(red, LOW);
					digitalWrite(yellow, LOW);
					delay(11000); 

					// Yellow light 1
					digitalWrite(yellow, HIGH);
					digitalWrite(red, LOW);
					digitalWrite(green, LOW);
					delay(3000);

					// Red light 1
					digitalWrite(red, HIGH);
					digitalWrite(yellow, LOW);
					digitalWrite(green, LOW);
					delay(1000);         

					/* Code for running lights on TL 2 */

					// Red Light 2
					digitalWrite(red2, HIGH); 
					digitalWrite(yellow2, LOW);
					digitalWrite(green2, LOW);
					delay(3000);

					// Green light 2
					digitalWrite(red2, LOW); 
					digitalWrite(yellow2, LOW);
					digitalWrite(green2, HIGH);
					delay(11000);

					// Yellow light 2
					digitalWrite(red2, LOW); 
					digitalWrite(yellow2, HIGH);
					digitalWrite(green2, LOW);
					delay(3000);

					// Red light 2
					digitalWrite(red2, HIGH);
					digitalWrite(yellow2, LOW);
					digitalWrite(green2, LOW);
					delay(2000);
				}